﻿<UserControl x:Class="YALV.View.Components.MessageView"

  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 

  xmlns:cult="clr-namespace:YalvLib.ViewModel;assembly=YALVLib"
  xmlns:Properties="clr-namespace:YalvLib.Strings;assembly=YALVLib"

  mc:Ignorable="d" 
  d:DesignHeight="300" d:DesignWidth="300">

  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="5" />
      <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <Grid Grid.Column="0"
                HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
      <!-- Message -->
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>

      <TextBlock Margin="3"
                 Text="{x:Static Properties:Resources.MainWindow_DetailsBox_Message_Text}" Grid.Row="0" />

      <TextBox Grid.Row="1" BorderBrush="Silver"
               DataContext="{Binding YalvLogViewModel.LogEntryRows}"
               Text="{Binding Path=SelectedLogItem.Message, Mode=OneWay}"
               AcceptsReturn="True"
               ScrollViewer.CanContentScroll="True"
               ScrollViewer.VerticalScrollBarVisibility="Auto"
               ScrollViewer.HorizontalScrollBarVisibility="Auto"
               Margin="3"
               IsReadOnly="True"
               HorizontalContentAlignment="Stretch"
               VerticalContentAlignment="Stretch"
               VerticalAlignment="Stretch"
               HorizontalAlignment="Stretch"
               TextWrapping="NoWrap" />
    </Grid>

    <!-- Splitter between Message and Throwable -->
    <GridSplitter Grid.Column="1" Opacity="0.15"
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                   />

    <Grid Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
      <!-- Throwable -->
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>

      <TextBlock Margin="3"
                 Text="{x:Static Properties:Resources.MainWindow_DetailsBox_Throwable_Text}" Grid.Row="0" />

      <TextBox Grid.Row="1" BorderBrush="Silver"
               Text="{Binding Path=SelectedLogItem.Throwable, Mode=OneWay}" DataContext="{Binding YalvLogViewModel.LogEntryRows}"
               Margin="3"
               IsReadOnly="True"
               AcceptsReturn="True"
               ScrollViewer.CanContentScroll="True"
               ScrollViewer.VerticalScrollBarVisibility="Auto"
               ScrollViewer.HorizontalScrollBarVisibility="Auto"
               TextWrapping="NoWrap"/>
    </Grid>
  </Grid>
</UserControl>
